"use client";

import Link from "next/link";
import { usePathname } from "next/navigation";
export default function Navigation({
  pages,
}: {
  pages: { href: string; name: string }[];
}) {
  const pathname = usePathname();
  return (
    <div className="navigation fixed top-0 left-0 z-50">
      {pages.map((page) => {
        return (
          <Link
            href={page.href}
            key={page.href}
            className={pathname === page.href ? "selected" : ""}
          >
            {page.name}
          </Link>
        );
      })}
    </div>
  );
}
